fix: Update server capacity calculation#6163
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6163 +/- ##
===========================================
- Coverage 55.78% 49.06% -6.73%
===========================================
Files 931 910 -21
Lines 76751 75838 -913
Branches 525 353 -172
===========================================
- Hits 42814 37208 -5606
- Misses 33909 38606 +4697
+ Partials 28 24 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a281b5e to
7082113
Compare
There was a problem hiding this comment.
Pull request overview
Updates the heuristic used by Press to pick the least-loaded public primary server per cluster for use_for_new_sites / use_for_new_benches, normalizing site CPU load by server vCPU capacity.
Changes:
- Updates the scoring definition to use
(sum(site_plan.cpu_time_per_day for non-archived/suspended sites)) / server_vcpu. - Adds a QueryBuilder query to fetch server vCPU capacity (via Server Plan) with a fallback to 1.
- Ensures every server in
server_namesreceives a score entry (including servers with no eligible sites).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7082113 to
27bd19c
Compare
5eb41b0 to
e98a603
Compare
- Update heurisitic to set use_for_new_site & and use_for_new_benches flags in server record: - Weight sum of sum of site plan cpu_time_per_day across all sites against server vcpu capacity
- Consider active, public primary servers for each cluster - Fetch available memory and available vCPU for all servers in bulk from Prometheus - Mark the server with most memory for new benches and the one with most vCPU for new sites
…nch creation: - These flags are maintained by refresh_new_bench_and_site_server_pool background job. - This validation prevents site/bench creation failures for newly created clusters before the job runs.
- Prefer use_for_new_sites and use_for_new_benches via ordering instead of filtering to avoid selection failures
a11590d to
891673f
Compare
|
🎉 This PR is included in version 0.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Update logic for use_for_new_benches and use_for_new_sites server flags are refreshed
Misc: